package qc.module.platform.api.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import qc.common.core.exception.QCPromptException;
import qc.module.platform.dto.user.UserContactDto;
import qc.module.platform.dto.user.UserContactQueryConditionDto;
import qc.module.platform.service.UserContactService;

import java.util.List;

/**
 * @projectName: qcdp
 * @package: qc.module.platform.api.controller
 * @className: UserContactController
 * @version: 1.0
 */
@RestController
@RequestMapping("/usercontact")
public class UserContactController {
    private UserContactService userContactService;

    @Autowired
    public void setUserContactService(UserContactService userContactService) {
        this.userContactService = userContactService;
    }


    /**
     * 查询用户联系信息
     *
     * @param condition: 查询条件
     * @return List<UserContactDto>  查询结果集
     * @author QcCheng Tech
     * @date 2023/10/9
     */
    @RequestMapping(value = "/query", method = {RequestMethod.GET, RequestMethod.POST})
    public List<UserContactDto> query(@RequestBody UserContactQueryConditionDto condition) throws QCPromptException {
        return userContactService.query(condition);
    }
}
